package lab2;

/**
 * <p>Title: FlyTest2</p>
 * <p>Description: CS 235 Lab #2</p>
 *         Example of use of the Airplane_noEncap and Jet_noEncap
 *         classes.
 *         This class shows how a simple non-use of encapsulation may be OK.
 * @author This code is from "Head First Object Oriented Design"
 * @date   February 4th 2013
 * @team   
 */
public class FlyTest2 {

	/**
	 * main method for FlyTest2 - this program prints out 
	 * a speed for a plane.
	 * @param args
	 */
	public static void main(String[] args) {
		/*
		 * using the "non-encapsulated" version of Airplane,
		 * we can set the public data member "speed" from outside 
		 * the class without using the setSpeed and getSpeed methods.
		 */
		Airplane_noEncap biplane = new Airplane_noEncap();
		biplane.speed = 212;
		System.out.println(biplane.speed);
		/*
		 * This program looks OK and is predictable. There usually
		 * isn't a problem with not using encapsulation in a very
		 * small program but in bigger programs it can be a serious
		 * problem.
		 */
	}
}
